<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8">
        <title></title>
        <script src="js/jquery-1.11.0.min.js"></script>
        <script src="js/echarts.min.js"></script>
    </head>
    <body>
	线程数：<input id="thread"></input></br>
	请求数：<input id="request"></input></br>
	url：<input id="url" value="http://www.baidu.com"></input></br>
	<button id="submit" onclick="submit()"></button>
        <div id="main" style="width: 900px;height:400px;"></div>
 
    </body>
 
    <script type="text/javascript">
        function bb() {
			var myChart = echarts.init(document.getElementById('main'));
			var date = [];
var randomData = [];
 
for(var i = 0; i<30; i++){
	date.push('第' + (i+1) + '天');
	randomData.push(Math.floor(Math.random()*100));
}
 
// 指定图表的配置项和数据
var option = {
    xAxis: {
        type: 'category',
        data: date
    },
    yAxis: {
        type: 'value'
    },
    series: [{
        data: randomData,
        type: 'line'
    }]
};
 
// 使用刚指定的配置项和数据显示图表。
myChart.setOption(option);	
 
var len = date.length;
 
setInterval(function(){
	for(var i = 0; i<300; i++){
		date.push(len++);
		randomData.push(Math.floor(Math.random()*100));
	}
	//randomData.shift();
	date.push(len++);
	//date.shift();
	myChart.setOption({
	    xAxis: {
	        data: date
	    },
        series: [{
            data: randomData
        }]
    });	
}, 500)}
function submit(){
			bb();
		}
    </script>
 
</html>